from pathlib import Path
import re
import sys
import subprocess as p

DEPS_DIR=Path('arkcompiler','runtime_core','static_core','scripts','dep-lists',)

FILES = [
    'requirements-doc-dev',
    'requirements-python3',
    'requirements-venv-python3',
]

PAT=re.compile(r'^(.*)==.*$')


def _packages(deps: Path):
    for file in FILES:
        with (deps / file).open(encoding='utf-8') as fp:
            for line in fp:
                if m:=PAT.match(line):
                    yield str(m.group(1)).strip()

def main(panda_dir: str):
    for p in _packages(Path(panda_dir).expanduser() / DEPS_DIR):
        print(p)



if __name__ == '__main__':
    main(sys.argv[1])